<?php
namespace app\index\controller;

use app\index\model\Vocation;
use think\Db;

class Host extends Base
{
  public function index()
  {
    $vocation = new Vocation();
    // $post = input('get.');
    // if(isset($post['/index/host/index/nid/1_html'])){
    //   $navOne = Db::name('vocation')->order('id asc')->where('type','=',1)->limit(11)->select();  //国内
    //   $workInt = $vocation::with('work')->order('id asc')->where('type','=',1)->limit(11)->select(); //国内
    //   $this->assign(array(
    //     'navOne' => $navOne,
    //     'workInt' => $workInt
    //   ));
    // } else {
      $navOne = Db::name('vocation')->order('id asc')->where('type','=',2)->limit(11)->select();  //国外
      $workInt = $vocation::with('work')->order('id asc')->where('type','=',2)->limit(11)->select(); //国外
      $this->assign(array(
        'navOne' => $navOne,
        'workInt' => $workInt
      ));
    // }
    return view();
  }
}
?>